package com.ruoyi.common.net.mqtt;

import org.eclipse.paho.client.mqttv3.MqttMessage;
import org.springframework.messaging.Message;

/**
 * @author xumh
 * @title: IMessageHandler
 * @description: TODO
 * @date 2024/12/1815:01
 */
public interface IMessageHandler {
    default String clientId() {
        return null;
    }

    void init();

    void subscribe();

    default void connected(boolean reconnect, String serverURI) {
    }

    default void handle(Message<?> message) {
    }

    default void handle(String message) {
    }

    default void handle(String topic, String message) {
    }

    default void handle(String clientId, String topic, String message, MqttMessage mqttMessage) {
    }
}
